package com.baihui.taobao.action;

import com.baihui.taobao.AppConstants;
import com.baihui.taobao.util.Util;
import com.opensymphony.xwork2.ActionSupport;

public class ExecPayUserAction extends ActionSupport {

	private static final long serialVersionUID = 7803674731599166199L;
	public String baihuiId;
	public String appName;
	public String webAddress;
	public String sign;
	public int finish;
	public String exportCSVpath;
	
	public String getAppName() {
		return appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	public int getFinish() {
		return finish;
	}

	public void setFinish(int finish) {
		this.finish = finish;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	public String getWebAddress() {
		return webAddress;
	}

	public void setWebAddress(String webAddress) {
		this.webAddress = webAddress;
	}

	public String getBaihuiId() {
		return baihuiId;
	}

	public void setBaihuiId(String baihuiId) {
		this.baihuiId = baihuiId;
	}

	public String getExportCSVpath() {
		return exportCSVpath;
	}

	public void setExportCSVpath(String exportCSVpath) {
		this.exportCSVpath = exportCSVpath;
	}

	@Override
	public String execute() throws Exception {

		StringBuffer webaddressbuf = new StringBuffer();
		sign = Util.md5Signature((AppConstants.APPKEY + AppConstants.SECRET));
		webaddressbuf.append("/manager/webaddress.action?baihuiId=");
		webaddressbuf.append(baihuiId);
		webaddressbuf.append("&sign=");
		webaddressbuf.append(sign);

		webAddress = webaddressbuf.toString();
		
		StringBuffer exportCSVBuf = new StringBuffer();
		exportCSVBuf.append("/manager/exportCSVAddress.action?baihuiId=");
		exportCSVBuf.append(baihuiId);
		exportCSVBuf.append("&sign=");
		exportCSVBuf.append(sign);
		exportCSVpath = exportCSVBuf.toString();
		// 未完成实施的标志
		finish = 0;
		return SUCCESS;
	}
public static void main(String[] a){
	String sign = Util.md5Signature((AppConstants.APPKEY + AppConstants.SECRET));
	System.out.println(sign);
}
}
